module(
    name = "rules_closure",
    version = "0.15.0",
)

bazel_dep(
    name = "bazel_skylib",
    version = "1.7.1",
)

bazel_dep(
    name = "platforms",
    version = "0.0.5",
)

# TODO(mollyibot): Remove this in the future.
bazel_dep(
    name = "rules_proto",
    version = "7.0.2",
)

bazel_dep(
    name = "protobuf",
    version = "31.0",
    repo_name = "com_google_protobuf",
)

bazel_dep(
    name = "google_bazel_common",
    version = "0.0.1",
)

bazel_dep(
    name = "rules_webtesting",
    version = "0.4.1",
    repo_name = "io_bazel_rules_webtesting",
)

bazel_dep(
    name = "rules_web_testing_java",
    version = "0.4.1",
    repo_name = "io_rules_web_testing_java",
)

##### Java dependencies #####
bazel_dep(
    name = "rules_java",
    version = "8.6.1",
)

bazel_dep(
    name = "rules_jvm_external",
    version = "6.6",
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

maven.install(
    artifacts = [
        "args4j:args4j:2.33",
        "com.google.closure-stylesheets:closure-stylesheets:1.5.0",
        "com.google.dagger:dagger-producers:2.43.2",
        "com.google.jimfs:jimfs:1.1",
        "net.java.dev.javacc:javacc:7.0.13",
        "org.jsoup:jsoup:1.16.1",
        "org.seleniumhq.selenium:selenium-remote-driver:4.27.0",
        "org.seleniumhq.selenium:selenium-api:4.27.0",
        "org.seleniumhq.selenium:selenium-support:4.27.0",
    ],
)

# Using maven.artifact here because the version number vxxxxx cannot parsed correctly.
maven.artifact(
    artifact = "closure-compiler",
    group = "com.google.javascript",
    version = "v20250402",
)

# javacc:javacc was not updated since 2008 and relocated to net.java.dev.javacc
maven.override(
    coordinates = "javacc:javacc",
    target = "@maven//:net_java_dev_javacc_javacc",
)

use_repo(maven, "maven")

##### Python dependencies #####
bazel_dep(
    name = "rules_python",
    version = "1.0.0",
)

##### Other dependencies #####
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
    name = "fonts_noto_mono_deb",
    sha256 = "71ff715cf50a74a8cc11b02e7c906b69a242d3d677e739e0b2d18cd23b7de375",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/f/fonts-noto/fonts-noto-mono_20161116-1_all.deb",
        "http://http.us.debian.org/debian/pool/main/f/fonts-noto/fonts-noto-mono_20161116-1_all.deb",
    ],
)

http_file(
    name = "libexpat_amd64_deb",
    sha256 = "682d2321297c56dec327770efa986d4bef43a5acb1a5528b3098e05652998fae",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/e/expat/libexpat1_2.1.0-6+deb8u3_amd64.deb",
        "http://http.us.debian.org/debian/pool/main/e/expat/libexpat1_2.1.0-6+deb8u3_amd64.deb",
    ],
)

http_file(
    name = "libpng_amd64_deb",
    sha256 = "a57b6d53169c67a7754719f4b742c96554a18f931ca5b9e0408fb6502bb77e80",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u2_amd64.deb",
        "http://http.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u2_amd64.deb",
    ],
)

http_file(
    name = "libfontconfig_amd64_deb",
    sha256 = "0bb54d61c13aa5b5253cb5e08aaca0dfc4c626a05ee30f51d0e3002cda166fec",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.3+deb8u1_amd64.deb",
        "http://http.us.debian.org/debian/pool/main/f/fontconfig/libfontconfig1_2.11.0-6.3+deb8u1_amd64.deb",
    ],
)

http_file(
    name = "libfreetype_amd64_deb",
    sha256 = "80184d932f9b0acc130af081c60a2da114c7b1e7531c18c63174498fae47d862",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.5.2-3+deb8u1_amd64.deb",
        "http://http.us.debian.org/debian/pool/main/f/freetype/libfreetype6_2.5.2-3+deb8u1_amd64.deb",
    ],
)

http_file(
    name = "fonts_noto_hinted_deb",
    sha256 = "a71fcee2bc7820fc4e0c780bb9c7c6db8364fd2c5bac20867c5c33eed470dc51",
    urls = [
        "https://mirror.bazel.build/http.us.debian.org/debian/pool/main/f/fonts-noto/fonts-noto-hinted_20161116-1_all.deb",
        "http://http.us.debian.org/debian/pool/main/f/fonts-noto/fonts-noto-hinted_20161116-1_all.deb",
    ],
)

platform_http_file = use_repo_rule("//closure/private:platform_http_file.bzl", "platform_http_file")

platform_http_file(
    name = "phantomjs",
    amd64_sha256 = "86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f",
    amd64_urls = [
        "https://mirror.bazel.build/bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2",
        "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2",
    ],
    macos_sha256 = "538cf488219ab27e309eafc629e2bcee9976990fe90b1ec334f541779150f8c1",
    macos_urls = [
        "https://mirror.bazel.build/bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip",
        "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip",
    ],
)
